#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
class Solution {
public:

    bool VerifySquenceOfBST(vector<int> sequence)
    {
        if (sequence.size() == 0)
            return false;
        int start = 0;
        int end = sequence.size() - 1;
        while (end >= 0)
        {
            while (sequence[start] < sequence[end])
            {
                ++start;
            }
            while (sequence[start] > sequence[end])
            {
                ++start;
            }
            if (start != end) return false;
            end--;
            start = 0;
        }
        return true;
    }

private:
    stack<int> st;
};

int main()
{

    return 0;
}
